What is the inverse of the function $g(x)=\dfrac{-x-2}{x+4}$ ? $g^{-1}(x) =$
Solution: Let's start by replacing $g(x)$ with $y$. $y=\dfrac{-x-2}{x+4}$ Now let's swap $x$ and $y$ and solve for $y$. $\dfrac{-y-2}{y+4}=x$ [Why do we swap x and y?] $\begin{aligned} \dfrac{-y-2}{y+4}&=x \\\\ -y-2&=x(y+4) \\\\ -y-2&=xy+4x \\\\ -y-xy&=4x+2 \\\\ y(-1-x)&=4x+2 \\\\ y&=\dfrac{4x+2}{-1-x} \end{aligned}$ In conclusion, this is the inverse function: $g^{-1}(x)=\dfrac{4x+2}{-1-x}$ [I saw someone solve this problem by originally solving for x. Were they wrong?]